#ifndef PID_H_
#define PID_H_

// Structures for PID (from Embedded.com article)
typedef struct
{
	long dState;		// Last position input
	long iState;		// Integrator state
	long iMax, iMin;	// Max and min allowable integrator state
	
	long iGain;			// Integral gain
	long pGain;			// Proportional gain
	long dGain;			// Derivative gain
} SPid;

// Public functions for PID
long PIDUpdate(SPid* pid, long error, long derivative);

#endif /*PID_H_*/
